import turtle

# 创建一个窗口和画笔
screen = turtle.Screen()
screen.bgcolor("white")

pen = turtle.Turtle()
pen.speed(0)
pen.left(90)
pen.penup()
pen.backward(150)
pen.pendown()
pen.color("brown")

# 绘制分形树的函数
def draw_branch(length):
    if length > 5:
        pen.forward(length)
        pen.right(20)
        draw_branch(length - 15)
        pen.left(40)
        draw_branch(length - 15)
        pen.right(20)
        pen.backward(length)

# 开始绘制
draw_branch(100)

# 点击关闭窗口
screen.exitonclick()